mir: compute the modifiers using the saved button_state on key events
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 2 Dec 2014 15:27:28 +0000 (16:27 +0100)
committerWilliam Hua <william@attente.ca>
Thu, 5 Feb 2015 16:26:17 +0000 (17:26 +0100)
gdk/mir/gdkmireventsource.c

index 701f394be2e9d783c8eb0022f8a7d6dc07054ff4..13f09bbd493a79c18b5f910cb460c20382206f12 100644 (file)
@@ -258,10 +258,13 @@ get_modifier_state (unsigned int modifiers, unsigned int button_state)
 static void
 handle_key_event (GdkWindow *window, const MirKeyEvent *event)
 {
+  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
   guint modifier_state;
+  MirMotionButton button_state;
   gboolean is_modifier = FALSE;
 
-  modifier_state = get_modifier_state (event->modifiers, 0); // FIXME: Need to track button state
+  _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
+  modifier_state = get_modifier_state (event->modifiers, button_state);
 
   switch (event->action)
     {